package com.nbicc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nbicc.mapper.UserMapper;
import com.nbicc.pojo.User;
import com.nbicc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName:
 * @Author: 仄言in
 * @Desctiption: (描述)
 * @Date: 2021/5/10 22:01
 * @Version 1.0 (版本)
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    @Transactional
    public User login(User user) {
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("uname",user.getUname());
        User users = (User) userMapper.selectOne(wrapper);
        return users;
    }
}
